<template>
  <div>
    <h4>肿瘤病史</h4>
    <el-form :model="zlForm" label-width="80px" size="mini">
      <el-form-item label="诊断名称:">
        <el-checkbox-group v-model="zlForm.diagnosisName">
          <el-checkbox label="胸腺瘤" name="diagnosisName" />
          <el-checkbox label="胸腺癌" name="diagnosisName" />
          <el-checkbox label="肾癌" name="diagnosisName" />
          <el-checkbox label="胃癌" name="diagnosisName" />
          <el-checkbox label="肺癌" name="diagnosisName" />
          <el-checkbox label="其他肿瘤" name="diagnosisName" />
        </el-checkbox-group>
      </el-form-item>
      <el-form-item label="年份:">
        <el-date-picker v-model="zlForm.years" type="year" placeholder="选择年" />
      </el-form-item>
      <el-form-item label="治疗方式:">
        <el-checkbox-group v-model="zlForm.treatment" @change="handleChecked">
          <el-checkbox label="药物" name="treatment" />
          <el-checkbox label="手术" name="treatment" />
          <el-checkbox label="放疗" name="treatment" />
          <el-checkbox label="化疗" name="treatment" />
        </el-checkbox-group>
      </el-form-item>
      <el-form-item v-show="wayValue.indexOf('放疗') !== -1" label="放疗:">
        <el-radio-group v-model="zlForm.medicine">
          <el-radio :label="1">术前放疗</el-radio>
          <el-radio :label="2">术中放疗</el-radio>
          <el-radio :label="3">术后放疗</el-radio>
        </el-radio-group>
      </el-form-item>
    </el-form>
    <el-divider />
  </div>
</template>

<script>
export default {
  data() {
    return {
      zlForm: {
        id: '',
        diseaseName: '1',
        diagnosisName: [
          '胸腺瘤'
        ],
        treatment: [
          '放疗'
        ],
        medicine: 0,
        pid: this.pId
      },
      wayValue: []
    }
  },
  inject: [
    'pId'
  ],
  created() {
    this.wayValue = this.zlForm.treatment
  },
  methods: {
    onSubmit() {
      console.log('submit!')
    },
    handleChecked(v) {
      this.wayValue = v
    }
  }
}
</script>

<style>

</style>
